007 screens and navigation
欢迎回来。
Welcome back.
让我们通过本次讲座了解如何在我们的应用程序上创建一些屏幕,然后在它们之间来回切换,我要告诉您的是,有很多选项可用于控制界面、在屏幕上布局组件并显示不同的事情并隐藏不同的事情。
Let's take this lecture and figure out how to create some screens on our application and then get back and forth between them something that I will tell you is that there are a lot of options for controlling your interface and laying out components on your screen and showing different things and hiding different things.
但对于本课程,我们将坚持基础知识。
But for this course we're going to be sticking with the basics.
我们将一次创建一个屏幕并一次显示一个屏幕并在它们之间导航。
We're going to be creating one screen at a time and showing one screen at a time and navigating between them.
是的。
Yes.
该软件的功能远不止于此。
This software can do so much more than that.
让我们从如何创建屏幕开始。
Let's start with how do we create a screen.
所以我要在这里关闭我的驱动程序,因为我现在不想看它。
So I'm going to close my driver here because I don't want to look at that right now.
我进入了这里的图形选项卡和项目资源管理器,当我到达屏幕时,我只需右键单击并按 Enter 键即可。
I came into my graphics tab down here and my project explorer and when I get up to screens I'm just going to right click and hit enter.
我可以对此进行描述或其他任何内容。
And I can give this a description or anything else.
因此,我们继续将其称为 main,只是因为缺乏更好的术语。
So let's go ahead and call this main just for lack of a better term.
我们甚至可以在运行时属性上放置一个标题栏。
And we can even put a titlebar on runtime properties.
我将继续将主屏幕放在此处,以防万一我们决定稍后显示标题栏。
I'll go ahead and put main screen right here just in case we decide to show the title bar later on.
这是我们必须设置的。
And that's something that we would have to set.
我喜欢我的决心,即公元 10 年 19 点 20 分。
I like my resolution that's my 19:20 by 10 A.D.
这意味着这将是一个全屏应用程序,您知道其他任何东西都不会可见。
which means this is going to be a full screen app and you know nothing else is going to be visible.
我现在就这样保留它,然后点击“确定”。
I'm just going to leave it like that for right now and I'm going to hit OK.
所以我有一个大的纯白色屏幕可供使用。
So I have a big plain white screen at my disposal.
那挺好的。
That's good.
但您知道我们将需要两个屏幕,因为我们要设置导航。
But you know we're going to need two screens because we want to set up navigation.
因此,我将再次右键单击屏幕并点击插入,对于此页面的描述,我将键入概述,因为我知道最终我将需要一个概述屏幕,所以我将继续并输入概览屏幕上也有一个标题。
So I'm going to right click on screen again and hit insert and for the description of this page I'm just going to type overview because I know eventually I'm going to need an overview screen so I'll go ahead and put a title on that as well overview screen.
听起来不错。
Sounds good.
我将保留分辨率和其他所有内容不变,然后单击“确定”。
I'll leave the resolution and everything else the same and I'll hit OK.
现在我在顶部有两个屏幕可以使用。
And now I've got two screens on the top to work with.
我需要一种方法来区分这些屏幕,然后在它们之间来回切换。
I need a way to a tell these screens apart and then be get back and forth between them.
因此,就区分它们而言,我只需单击文本,然后在此处放置一些文本,然后在主屏幕上输入内容。
So as far as telling them apart I'm going to just click on text and I'm going to put some text right here and I'm going to type main screen.
又好又简单。
Nice and simple.
然后我将复制该内容并转到屏幕 12 并粘贴它。
And then I will copy that and come over to screen 12 and paste it.
为此,我将替换它并输入概述屏幕。
And for that I will replace it and type out overview screen.
这实际上非常小,所以我将继续将其增加到 16,以便它更清晰一些,并且我将向我创建的第一个标签提供同样的礼貌。
And that's actually really small so I'll go ahead and just bump that up to 16 so that it's a little bit more legible and I'll extend the same courtesy to the first label that I created.
然后把它踢到角落里。
And then just kick that up in the corner.
你永远不知道我可能真的决定用它来做什么,但我们拭目以待。
You never know I might actually decide to use that for something but we'll see.
那么好吧。
So OK.
现在我实际上有两个不同的屏幕。
Now I've actually got two different screens.
现在我还需要做什么,我需要弄清楚如何在它们之间来回切换。
And what else do I need to do now I need to figure out how to get back and forth between them.
我们要到这里来。
We're going to come up here.
我们应该在图形功能区中,我这里有几个按钮,我有按钮,然后我有按钮,我要继续单击按钮,然后我要画出一个像这样的小按钮,然后双击它,我就为这个按钮提供了一个非常干净的小界面,所有内容都隐藏在高级字体图像和命令中。
We should be in the graphics ribbon and I've got a couple of buttons here I've got push button and then I've got button and I'm going to go ahead and click on button and then I'm just going to draw out a little small button like that and then double click on that and I've got a really clean little interface for this button and everything is kind of hidden away fonts images advanced and commands.
但现在我们想要什么,让我们继续并单击命令,一旦弹出,我们可以放入我们的 Visual Basic 脚本,如果我们真的很想使用 Wonder 很难,因为你可以在这里做很多不同的事情视觉基础。
But right now what we want let's go ahead and click on command and once this pops up we can put in our visual basic script if we really really want to use wonder where hard because there are lots of different things that you can do in here with Visual Basic.
但实际上我要点击这个下拉菜单,我想拉出我打开的屏幕,当我这样做时,我看起来好像没有任何屏幕,所以让我们关闭那里,为什么我们不任何屏幕。
But actually I'm going to click on this dropdown and I want to pull up my open screen and when I do I look and it seems like I don't have any screens so let's close out of there and why don't we have any screens.
因为虽然我还没有拯救他们。
Because while I haven't saved them yet.
因此,如果您在这里看到我的屏幕文件夹,它不会像其他文件夹那样在旁边显示这些小胡萝卜符号之一,而且它们里面有一些东西,这是因为我们的屏幕仍然是空的。
So if you see my screens folder over here it doesn't show one of these little Carrot's symbols next to it like other folders do and there's something inside of them that's because our screens are still empty.
因此,让我们来到这里,单击“全部保存”,然后我是否要保存屏幕 11 将屏幕 11 作为我的主屏幕,因此我只需在其上键入 main 并单击“保存”。
So let's come up here and click save all and do I want to save screen 11 will screen 11 as my main screen so I'll just type main on that and hit save.
那么屏幕 12 呢?
And what about screen 12.
这是我的概述,因此我将输入概述并单击“保存”。
That's my overview so I'll type out overview and hit save.
所以现在当我查看屏幕内部时,我实际上有几个屏幕。
So now when I look inside of my screens I actually have a couple of screens.
那么让我们回到这个按钮。
So let's go back into this button.
双击它。
Double clicking on that.
现在我们可以设置打开屏幕,所以我将告诉它打开概述屏幕,因为这实际上是这里的主屏幕。
And now we can set our open screen so I'm going to tell this to open the overview screen because this is actually the main screen right here.
然后我将返回到基本按钮属性,然后输入概述,因为这将导航到概述屏幕,我可以从其中退出,所以现在我有一个按钮,它将据说带我到概览屏幕,我将把它复制到我的概览屏幕中,然后按 Control V 再次粘贴。
And then I'll just go back to my basic button properties and I'm going to type in overview because that's going to be navigating to the overview screen and I can just X out of that so now I've got a button which will supposedly take me to the overview screen and I'm going to copy that come into my overview screen and hit Control V to paste that again.
当你在屏幕上付款时,它总是会出现在左上角,这有点烦人。
And when you pay something into a screen it always goes up to the top left corner which is kind of annoying.
我希望你能去新屏幕上的同一个地方,但它不会那样工作。
I wish you would go to the same place on the new screen but it doesn't work like that.
现在,打开屏幕,让我们继续单击此按钮并选择我们的主要原因。
So now for opening the screen let's go ahead and click on this and select our main cause.
现在我们想返回到主屏幕,然后我们将返回到按钮,我们还将更改标题以使其转到主屏幕,这样我们就可以退出该屏幕。
Now we want to go back to our main screen then we'll go back to button and we'll change the caption as well to make that go to main so we can X out of that.
所以现在我应该有办法在两个屏幕之间来回切换。
So now I should have a way to get back and forth between my two screens.
这看起来很简单。
That looks pretty simplistic.
让我们来到这里并单击“运行”。
Let's come up here and click on run.
所以现在我们第一次真正看到我们的应用程序正在运行,并且我们位于概览屏幕上。
So now for the first time we're actually going to get to see our application running and we're on the overview screen.
因此,当我们单击“Main”时,它会将我们带到主屏幕;当我们单击“overview”时,它会将我们带回到概述屏幕。
So when we click on Main it takes us to the main screen when we click on overview it takes us back to the overview screen.
所以这就完美了。
So that's perfect.
我将继续向您展示另一件事。
I'm going to go ahead and show you one more thing.
就我们而言,它可以称为导航,即使它实际上不是第一件事,而是如何摆脱困境。
As far as we can call it navigation even if it's really not first thing is how do you get out of this.
你知道你在这之中。
You know you're in this.
但它会锁定全屏,并且您实际上无法单击任何内容来退出。
But there is it locks up the full screen and there's really nothing you can click on to get out.
按住 Alt 键并点击 Tab,就会弹出这个小窗口选择器。
Hold down the Alt key and hit tab and that's going to bring up this little window selector.
我希望你接受那个写着“想知道 Indu 软弱到什么程度”的人,然后放开 Allt。
And I want you to take the one that says Wonder where Indu soft and then let go of Allt.
这样你就会回到这里,然后你就可以停止了。
So that'll bring you back in here and you can hit stop.
现在关闭应用程序。
And now that close the app.
好吧,让我们回到主屏幕,我将复制并粘贴此按钮,以便我在此处有另一个按钮。
Well let's go back to our main screen and I'm going to copy this button and paste it so that I have another one right here.
让我们双击该按钮,我们将对其进行一些更改,而不是打开屏幕。
Let's double click into that button and we're going to change this a little bit instead of opening a screen.
我们将转到 Visual Basic 脚本,这只是您必须学习的东西:美元符号 SHUT DOW ,然后是一组括号。
We're going to go to Visual Basic script and this is just something you have to learn dollar sign S H U T D O W in and then a set of parentheses.
因此,我们将向 Visual Basic 发送关闭命令,这将为我们关闭我们的应用程序。
So we're going to send the shut down command into Visual Basic and that's going to close our app for us.
因此,让我们回到按钮并更改此标题,然后只需输入 exit 即可将其关闭。
So let's go back to button and change this caption and we'll just type in exit and we can close that.
现在,当我们再次运行我们的应用程序时,您会看到我们位于概览屏幕上,我们可以进入主屏幕,然后我们可以点击退出,这将关闭我们的应用程序,而我们在这里可以设置的其他内容是我真的不希望概述屏幕成为我启动应用程序时加载的屏幕有人右键单击主屏幕,我将点击设置为启动。
And now when we run our application again you see we're on the overview screen we can go to main and then we can hit exit and that's just going to close our app and something else we can set while we're in here is I really don't want the overview screen to be the screen that loads when I start my app Some someone to right click on Main and I'm going to hit set as start up.
因此,让我们继续关闭这两个项目,然后进行测试。
So let's go ahead and close both of these and we'll test that.
我们可以单击“运行”,是的,它会加载。
We can click on run and yes it loads.
我的主屏幕。
My main screen.
所以这就完美了。
So that's perfect.
这就是内衣中最简单的基本导航形式。
That is the simplest basic form of navigation in underwear.
因此,现在您可以创建屏幕,保存这些屏幕,创建导航按钮以在这些屏幕之间来回切换,我们甚至可以直接从应用程序中导航出来。
So now you can create screens save those screens create navigational buttons to get back and forth between those screens and we can even navigate ourselves right out of the application.
那么我们就结束本次讲座,我们下次再见。
So we'll wrap it up on this lecture and I'll see you in the next cheers.